import 'package:dio/dio.dart';

import '../we_chat_api_service.dart';

///@author aidenquan
/// Created by junlintianxia on 1/15/21.

/// 添加通用动态修改baseUrl的拦截器
class WeChatDynamicUrlInterceptor extends InterceptorsWrapper {
  @override
  void onRequest(RequestOptions options, RequestInterceptorHandler handler) {
    options.baseUrl = getBaseUrl();
    // 继续请求责任链
    super.onRequest(options, handler);
  }

  String getBaseUrl() {
    return WeChatApiService.WECHAT_BASE_URL;
  }
}
